<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        #tab{
            width: 100%;
            border: 1px solid red;
            border-collapse: collapse;
            border-spacing: 0px;
        }
        #tab tr td{
            /* width: 100px; */
            /* height: 100px; */
            border: 1px solid black;
           
            
          
        }
    </style>
</head>
<body>
    
    <input type="text"id="inp1">
    <input type="text"id="inp2">
    <button id="btn">生成</button>
    <table id="tab">
        
    </table>


    <script>
       btn.onclick = function(){
           var res = ''

           var res1 = ''
        for(var i = 0;i<inp1.value;i++){
            res += '<tr>'
            for(var j = 0;j<inp2.value;j++){
                res += '<td>'+j+'</td>'
            }
            res += '</tr>'
        }
        
        

        tab.innerHTML = res
        
       }
    </script>
</body>
</html>